<?php
/**
 * Created by PhpStorm.
 * User: lenovo
 * Date: 2018/9/29
 * Time: 15:02
 */
include "config.php";
$uname=isset($_REQUEST["uname"])?$_REQUEST["uname"]:"";
$sql="SELECT *FROM userinfo WHERE u_name=?";
$res=$link->prepare($sql);
//绑定数据
$res->bind_param("s",$uname);
//执行sql语句
$res->execute();
//判断
$result=$res->get_result();
if($result->num_rows>=1){
    print_r("false");
}else{
    print_r("true");
}
$link->close();
